/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

window.onload = function(){
    var url = window.location;
    var qs = url.search;
    var qsArr = qs.split("&");

    var showInvLogin;
    var paramName;
    for (i=0; i < qsArr.length; i++){
        var param = qsArr[i].split("=");
        if (param[0] != null){
            paramName = param[0];
            showInvLogin = param[1];
        }
    }

    if(showInvLogin == "undefined" || ((paramName != "?noLogin") && (paramName != "?invalid"))){
        return;
    }

    if(showInvLogin == "1"){
        var loginBoxDiv = document.createElement("div");
        var newText;

        if(paramName == "?noLogin")
            newText = document.createTextNode("You have to be logged in to acces that page!");
        else
            newText = document.createTextNode("invalid username/password");
        loginBoxDiv.appendChild(newText);
        Element.setStyle(loginBoxDiv, "color: red");
        //Element.setOpacity(loginBoxDiv, 0.5);

        document.body.appendChild(loginBoxDiv);
    }
};
